package com.distribute.framework.core.web.servlet;

import java.io.CharArrayWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;

public class Lazy3qPrintWriter extends PrintWriter{
	private OutputStreamWriter osWriter = null;

	public Lazy3qPrintWriter(Writer out, OutputStreamWriter osWriter) {
		super(out);
		this.osWriter = osWriter;
	}

	public void write(char[] buf, int off, int len) {
		try {
		if(this.osWriter!=null)
			this.osWriter.write(buf, off, len);
		} catch (IOException e) {
			e.printStackTrace();
		}
		super.write(buf, off, len);
	}

	public void close() {
		super.close();
	}
}